package com.plugin.manager;


import com.plugin.common.LoginService;
import com.plugin.common.UserVo;
import com.plugin.manager.utll.LoginFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.net.MalformedURLException;


@RestController
public class LoginController {

    @GetMapping("/login")
    public UserVo login(@RequestParam String accessToken, @RequestParam String tenantId) throws ClassNotFoundException, MalformedURLException, InstantiationException, IllegalAccessException {
        LoginService loginService = LoginFactory.getService(tenantId);
        return loginService.loginByAccessToken(accessToken);
    }
}
